<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>

  </body>
  <script>
      var arr = [0,2,3,4,4,0,2,5];
       temp=[];
      for(var  i=0;i< arr.length;i++) {
        //indexof（string）中字串string在父串中首次出现的位置，从0开始！
            if(temp.indexOf(arr[i])<0) {
              temp.push(arr[i]);
            }
       }
       console.log(temp);
  </script>
</html>
